$(function(){
	window.oncontextmenu= function(){ return false; }
	$('body').keydown(function(e){ if(e.keyCode==123){ return false; } });
	/* 320-635-945(950)-1255 */
	function bro_resize(){
		var broW= $(window).width();

		if(broW<535){ $('#main_info').css({ width: 320 }); $('#header .logoimg').hide(); $('#arti_btn, #main_btn, #header span').hide(); }
		else if(broW>535&&broW<940){ $('#main_info').css({ width: 635 }); $('#header .logoimg').show(); $('#arti_btn, #main_btn, #header span').show(); }
		else if(broW>940){ $('#main_info').css({ width: 950 }); $('#arti_btn, #main_btn, #header span').show();	}
	}
	bro_resize();
	$(window).resize(bro_resize);

	$('#main_nav').hide();
	$('#main_btn').click(function(){ $('#arti_nav').hide(); $('#main_nav').slideToggle("slow"); });
	$('#main_nav li').click(function(){ $('#main_nav').hide(); });

	$('#menu_1').click(function(){ location.href='con_total.html'; });
	$('#menu_2').click(function(){ location.href='con_html.html'; });
	$('#menu_3').click(function(){ location.href='con_css.html';  });
	$('#menu_4').click(function(){ location.href='con_script.html'; });
	$('#menu_5').click(function(){ location.href='con_app.html'; });
	$('#menu_6').click(function(){ location.href='con_etc.html'; });

	$('#main_info').masonry({ itemSelector: '.contents', columnWidth: 1, isAnimated: true });

/* 2012.8.31 scroll Top */
	$('.arrow_up').click(function(){ 
		if(navigator.appVersion.indexOf('Chrome')!=-1){
			$('body').animate({ scrollTop: 0 });
		}else{ $('html').animate({ scrollTop: 0 }); }
		
	});

	
/* Contents Counting */
	var total_con= $('#main_info a').length; var html_con= $('a .arthtml').length;	var css_con= $('a .artcss').length;
	var script_con= $('a .artscript').length; var app_con= $('a .artapp').length;	var etc_con= $('a .artetc').length;
	
	var fileadd_a= String(location.href);
	var fileadd_b= String(fileadd_a).split("/");
	var fileadd_c= fileadd_b[fileadd_b.length-1];
	
	if(fileadd_c=='con_total.html'){
		$('#header span').text('전체 ('+total_con+') -'); $('#menu_2').text('HTML ('+html_con+')'); $('#menu_3').text('CSS ('+css_con+')'); 
		$('#menu_4').text('SCRIPT ('+script_con+')'); $('#menu_5').text('응용 ('+app_con+')'); $('#menu_6').text('기타 ('+etc_con+')');
		$('#menu_8').text('HTML ('+html_con+')'); $('#menu_9').text('CSS ('+css_con+')'); $('#menu_10').text('SCRIPT ('+script_con+')'); 
		$('#menu_11').text('응용 ('+app_con+')'); $('#menu_12').text('기타 ('+etc_con+')');
	}else if(fileadd_c=='con_html.html'){ $('#header span').text('HTML ('+html_con+') -');
	}else if(fileadd_c=='con_css.html'){ $('#header span').text('CSS ('+css_con+') -');
	}else if(fileadd_c=='con_script.html'){ $('#header span').text('SCRIPT ('+script_con+') -');
	}else if(fileadd_c=='con_app.html'){ $('#header span').text('응용 ('+app_con+') -');
	}else if(fileadd_c=='con_etc.html'){ $('#header span').text('기타 ('+etc_con+') -'); }
	
});